using System;
using dnAnalytics.Nli;

/// <summary>
/// Compute a dot product.
/// </summary>
internal class Program {
	[STAThread]
	private static void Main() {
		//use the MKL BLAS provider
		IBlas blas = Blas.Provider(BlasProvider.Mkl);
		
		double[] x = new double[] {1, 1, 1, 1, 1, 1, 1, 1};
		double[] y = new double[] {2, 2, 2, 2, 2, 2, 2, 2};

		//compute the dot product with itself
		double dot = blas.Ddot(x.Length, x, 1, x, 1);
		Console.WriteLine(dot);

		//compute the dot of x and y
		dot = blas.Ddot(x.Length, x, 1, y, 1);
		Console.WriteLine(dot);

		/* 
		Output:
		8
		16
		*/
	}
}